/**
 * @author Santa Antilles
 * @description
 * @date 2023/12/27-15:49:44
 */
import request from "../../utils/request.js";

// 读取食堂列表
// 参数：Restaurant类
export function querySatisfiedRestaurant(query){
    return request({
        url: '/system-manager/manage-restaurant/query',
        method: 'get',
        params: query
    })
}

// 读取食堂具体信息
// 参数：String(Long)食堂id
export function queryDetailedRestaurant(id){
    return request({
        url: '/system-manager/manage-restaurant/'+id,
        method: 'get'
    })
}

// 新增食堂
// 参数：{"restaurant": Restaurant类, "avatar": MultipartFile}
export function addRestaurant(query){
    return request({
        url: '/system-manager/manage-restaurant/add',
        method: 'post',
        data: query
    })
}

// 修改食堂信息
// 参数：{"restaurant": Restaurant类, "avatar": MultipartFile}
export function updateRestaurant(query){
    return request({
        url: '/system-manager/manage-restaurant/update',
        method: 'put',
        data: query
    })
}

// 删除食堂信息
// 如果这个食堂有菜品和管理员就不让他删
export function deleteRestaurant(ids){
    return request({
        url: '/system-manager/manage-restaurant/'+ids,
        method: 'delete'
    })
}

export function updateRestaurantStatus(data){
    return request({
        url: '/system-manager/manage-restaurant/updateStatus',
        method: 'put',
        data: data
    })
}